//
//  NetStatus.m
//  DA_V
//
//  Created by 中亿世联前台 on 15/6/8.
//  Copyright (c) 2015年 zhouhai. All rights reserved.
//

#import "NetStatus.h"
#import "Reachability.h"

@implementation NetStatus

- (instancetype)init{
    self = [super init];
    if (self) {
        Reachability *reach = [Reachability reachabilityForInternetConnection];
        NetworkStatus status = [reach currentReachabilityStatus];
        [self showNetWorkStatus:status];
    }

    return self;
}

#pragma 判断网络状态
-(void)showNetWorkStatus:(NetworkStatus)status{

    switch (status) {
        case NotReachable:
            self.networkStatus = @"无网络";
            break;
            case ReachableViaWiFi:
            self.networkStatus = @"WIFI";
            break;
            case ReachableViaWWAN:
            self.networkStatus = @"2G/3@";
            break;
            default:
            self.networkStatus = @"其他";
            break;
    }
}
@end
